//
//  HotPostViewController.m
//  HeSiad
//
//  Created by ZC on 15/4/27.
//  Copyright (c) 2015年 MWJ. All rights reserved.
//

#import "HotPostViewController.h"
#import "hotPostCell.h"
#import "PostDetailViewController.h"

@interface HotPostViewController ()

@end

@implementation HotPostViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title=@"热门帖";
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 5;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 50;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    UINib *nib=[UINib nibWithNibName:@"hotPostCell" bundle:nil];
    [self.hotPostTableView registerNib:nib forCellReuseIdentifier:@"hotPost"];
    
    static NSString *cellIdentifier=@"hotPost";
    hotPostCell *cell=[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
    
    cell.postReleaseTime.text= @"2015-05-01 12:04:30";
    cell.commentsNumber.text=@"3";
    cell.postContent.text=@"感觉自己萌萌哒";
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    PostDetailViewController *postDetail=[self.storyboard instantiateViewControllerWithIdentifier:@"postDetailVC"];
    [self.navigationController pushViewController:postDetail animated:YES];
    
}


@end
